<?php

/**
 * @author Martin Pernica
 * @copyright 2008
 */

 echo '<br /><h2><a href="index.php?p=components&name=categories">'.Lang::getBackGlobal('back').'</a></h2><br />';
 if(!empty($_POST['name'])){
    
    $name = Registry::get('db')->real_escape_string( $_POST['name'] );
    $description = Registry::get('db')->real_escape_string( $_POST['description'] );
    
    $query = $GLOBALS['db']->query("INSERT INTO {prefix}sections (name, description) VALUES('".$name."', '".$description."')");
    
    $log->write(8, 'com_sections', 'NOW()', 'User created new section', $_SESSION['id']);
    
	messageBox( Lang::getBack('com_sections', 'section_added') );
 }

$form = new Form;
$form->addTextbox('name', Lang::getBack('com_sections', 'name') );
$form->addTextbox('description', Lang::getBack('com_sections', 'description') );
$form->addSubmit('submit', Lang::getBackGlobal('submit'));

echo $form;

?>